vcRobotController
vcRobotController allows you control a robot and drive its joints. If you need realistic robot simulation, use vcRrsRobotController.
See in: Overview
Module: vcRobotics
Parent: vcServoController
Children -
Referenced by: vcRrsRobotController.InternalController
Properties
Learn how to use properties here. The properties are also inherited from the parent class.
| Name | Type | Access | Description |
| ApproachAxis | vcApproachAxis | RW | Defines how to orient the robot based on the orientation of the active tool frame. |
| Bases | vcList[vcBaseFrame] | R | Gets a list of all base frames available in controller. |
| ConfigurationMode | vcMotionConfigurationMode | RW | Defines the configuration mode for joints driven by robot controller during linear motion interpolation.See more0 = Fixed No change. That is, current configuration is used and does not change. 1 = Follow frame Configuration closest to previous joint values is used. 2 = Interpolate joint values Configuration is determined by point-to-point interpolation of joint values. |
| FlangeOffset | String | RW | Defines an offset from flange node origin.See moreGenerally, this is used when flange node origin is not the exact place where to mount a tool or kinematics structure to end of robot arm. |
| Kinematics | vcBehavior | RW | Defines the kinematics object used by the controller which describes the robot's kinematic structure. |
| LagTime | Real | RW | If linear motion, defines default lag time. |
| MaxAngularAccel | Real | RW | If linear motion, defines maximum acceleration for angular movement (degrees/s^2). |
| MaxAngularSpeed | Real | RW | If linear motion, defines maximum speed for angular movement (degrees/s). |
| MaxCartesianAccel | Real | RW | If linear motion, defines maximum acceleration for linear movement (mm/s^2). |
| MaxCartesianSpeed | Real | RW | If linear motion, defines maximum speed for linear movement (mm/s). |
| OrientationInterpolationMode | vcMatrixMode | RW | Defines the orientation interpolation mode for linear movement. |
| RootOffset | String | RW | Defines an offset from root node origin, thereby defining the start of kinematics structure. |
| SettleTime | Real | RW | If linear motion, defines default settle time. |
| Tools | vcList[vcToolFrame] | R | Gets a list of all tool frames available in controller. |
| TrackWorldFrameMode | vcTrackWorldFrame | RW | Defines Robot World Frame (RWF) of robot when mounted on track. 0 Track origin is used as RWF. 1 RWF of robot is used as RWF. |
| WorldTransformMatrix | vcMatrix | RW | Defines Robot World Frame of robot. |
Methods
Learn how to use methods here. The methods are also inherited from the parent class.
| Name | Return Type | Parameters | Description |
| addBase | vcBaseFrame | None | Adds a new base frame to controller. Returns: vcBaseFrame: new base frame |
| addTarget | None | vcMatrix matrix, Optional Keyword[tmode = Integer] | Adds a given motion target or target matrix to robot target list.See moreIf target matrix, current settings of robot controller are used and an optional target_mode can be given to define how target relates to robot. This is similar to moveTo() method. Generally, you use addTarget() when you are creating a batch of targets and the robot will use non-zero accuracy limits. Parameters: (target: vcMotionTarget) or (matrix: vcMatrix, target_mode: vcMotionTargetMode (optional)) |
| addTarget | None | vcMotionTarget target | - |
| addTool | vcBaseFrame | None | Adds a new tool frame to controller. Returns; vcBaseFrame: new tool frame |
| clearTargets | None | None | Removes all motion targets and target matrices from robot target list. |
| createMotionInterpolator | vcMotionInterpolator | None | Creates a new motion interpolator for robot. Returns: vcMotionInterpolator: motion interpolator. |
| createTarget | vcMotionTarget | Optional Keyword[matrix = vcMatrix] | Create a new motion target using current controller settings, and then returns the new motion target.See moreAn optional matrix argument can be given to define target matrix of target. Parameters: matrix: vcMatrix (optional) Returns: vcMotionTarget: created target. |
| move | object | None | Moves robot to all targets in robot target list. Python execution will wait until robot has motioned to all previously added targets. |
| moveImmediate | None | vcMatrix matrix, Optional Keyword[tmode = Integer] | Moves robot to a given target immediately. An optional target_mode argument can be given to define how target relates to robot. See moreParameters: target: vcMotionTarget target_mode: vcMotionTargetMode (optional) |
| moveImmediate | None | vcMotionTarget target | - |
| moveRelTo | object | vcVector offset, Optional Keyword[tmode = Integer] | Moves robot to a position relative to current robot pose using current controller settings.See moreAn optional target_mode argument can be given to define how target relates to robot. Parameters: (offset: vcVector, target_mode: vcMotionTargetMode) (X: Real, y: Real, z:Real, target_mode: vcMotionTargetMode) |
| moveRelTo | object | Real x, Real y, Real z, Optional Keyword[tmode = Integer] | - |
| moveTo | object | vcMatrix matrix, Optional Keyword[tmode = Integer] | Moves robot to a given target or matrix, thereby clearing any previously added targets.See moreAn optional target_mode argument can be given to define how target relates to robot. Parameters: (target: vcMotionTarget) (matrix: vcMatrix, target_mode: vcMotionTargetMode) |
| moveTo | object | vcMotionTarget target | - |
| removeBase | None | vcBaseFrame base | Removes a given Base from controller. Parameters: Base (vcBaseFrame): Base to remove |
| removeTool | None | vcBaseFrame tool | Removes a given Tool from controller. Parameters: Tool (vcBaseFrame): Tool to remove |
Events
Learn how to use events here. The events are also inherited from the parent class.
| Name | Parameters | Description |
| OnPosition | None | Triggered when robot reaches a motion target in its robot target list. Parameters: robot: vcRobotController |
Example: Move Robot
"""Move robot""" import vcCore as vc import vcBehaviors as vc_beh import vcRobotics as vc_robo app = vc.getApplication() comp = vc.getComponent() async def OnRun(): """Move robot with vcRobotController""" ctr = comp.findBehavior(vc_beh.vcBehaviorType.ROBOT_CONTROLLER) ctr.clearTargets() # Create motion target and set it up motion_target = ctr.createTarget() motion_target.BaseName = ctr.Bases[0].Name motion_target.ToolName = ctr.Tools[0].Name motion_target.JointValues = [x.CurrentValue for x in ctr.Joints] motion_target.RobotConfig = 0 # Create target matrix target_matrix = vc.vcMatrix.new() target_matrix.P = vc.vcVector.new(800.0, -200.0, 600.0) target_matrix.WPR = vc.vcVector.new(0.0, 180.0, 0.0) # Add first motion as PTP motion_target.MotionType = vc_robo.vcMotionType.JOINT motion_target.Target = target_matrix motion_target.JointSpeedFactor = 1.0 ctr.addTarget(motion_target) # Reuse motion target object for next motions, just change motion type and target matrix motion_target.MotionType = vc_robo.vcMotionType.LINEAR motion_target.CartesianSpeed = 200.0 target_matrix.P = vc.vcVector.new(1200.0, -200.0, 600.0) motion_target.Target = target_matrix ctr.addTarget(motion_target) target_matrix.P = vc.vcVector.new(1200.0, 200.0, 600.0) motion_target.Target = target_matrix ctr.addTarget(motion_target) target_matrix.P = vc.vcVector.new(800.0, 200.0, 600.0) motion_target.Target = target_matrix ctr.addTarget(motion_target) target_matrix.P = vc.vcVector.new(800.0, -200.0, 600.0) motion_target.Target = target_matrix ctr.addTarget(motion_target) # Move robot through all targets await ctr.move()